package com.nuc.bigdata.feign;

import com.nuc.bigdata.feign.entity.CommodityDetailFeign;
import com.nuc.bigdata.feign.entity.CommodityFeign;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.ArrayList;

/**
 * @author JackLuo
 * @date 2019/11/28
 */
@FeignClient("oa-commodity")
public interface CommodityServiceFeign {

    /**
     * 获取所有的商品feign
     * @param pageSize 查询页码
     * @return  包含商品feign的ArrayList
     */
    @GetMapping("/oa-commodity/goods")
    ArrayList<CommodityFeign> listAllCommodity(@RequestParam("pageSize")Long pageSize);

    /**
     * 根据商品唯一标识获取商品详情feign
     * @param commodityId 商品唯一标识
     * @return 提供给front服务的商品详情feign
     */
    @GetMapping("/oa-commodity/goods/{commodityId}")
    CommodityDetailFeign queryDetailByCommodityId(@PathVariable("commodityId")String commodityId);

    /**
     * 根据商品唯一标识获取商品大概feign
     * @param commodityId 商品唯一标识
     * @return 提供给front服务的商品大概feign
     */
    @GetMapping("/oa-commodity/goods/{commodityId}/rough")
    CommodityFeign queryCommodityFeignById(@PathVariable("commodityId")String commodityId);
}
